Several methods exist that model documents as labeled trees. These methods are based on the fact that any semi-structured document that uses a markup language can be represented as a tree such as a Document Object Model (DOM) tree. The labels of the nodes correspond to the tags in the markup language. These methods define the structural dissimilarity between a pair of documents as the edit distance between the corresponding labeled trees. This is the tree model for the representation of the structural information.
The basic idea behind all tree edit distance algorithms is to find the cheapest sequence of edit operations that will transform one tree into another. Some of these methods model documents as ordered labeled trees, while others model them as unordered labeled trees. In general, finding the edit distance between unordered labeled trees is computationally more complex than finding the edit distance between ordered labeled trees. A key differentiator among the various tree distance algorithms is the set of edit operations allowed.
Some work in this area used insertion and deletion of leaf nodes and relabelling of a node anywhere in the tree. Several other approaches with different sets of edit operations are proposed. These tree edit distance measures have been modified to address issues such as repetitive and optional fields.
For instance, Nierman et al [Andrew Nierman, H. V. Jagadish, “Evaluating Structural Similarity in XML Documents”, Proceedings of the Fifth International Workshop on the Web and Databases (WebDB 2002), June 2002] propose a dynamic programming algorithm that computes the distance between any pair of documents taking into account Extensible Markup Language (XML) issues such as optional and repeated sub-elements. Andrews et al further give a method to cluster documents based on this distance measure. The algorithm to compute the tree edit distance for a pair of documents is of quadratic complexity in the combined size of the two documents.
Cruz et al [Isabel F. Cruz and Slava Borisov and Michael A. Marks and Timothy R. Webb, “Measuring Structural Similarity Among Web Documents: Preliminary Results”, Lecture Notes in Computer Science, volume 1375, page 513, 1998] propose an alternative approach to modeling structure based on tag frequency measures. This approach can be viewed as the node model for the representation of the structural information, since this approach only uses information about the tags of the various nodes in the corresponding tree model.
The method of Isabel et al relies on the assumption that tag frequencies reflect some inherent characteristics of Web documents and correlate with its structure. While the node model is very simple, the model does not take into account the order in which tags appear. Therefore, if the tags of all nodes are rearranged, the representation does not change. Thus, the model is adequate only when the templates are drastically different from each other, that is, they have very few tags in common. This is rarely the case in practice.
In view of the above comments, a need clearly exists for an improved manner of comparing documents for determining the structural similarity of the documents.